#include <iostream>
#include <set>

using std::cout;
using std::cin;
using std::endl;
using std::set;
using std::move;

class X
{
private:
    int _i;
public:
    X(int i = 0) : _i(i)
    { cout << "created! &x=" << this << ", i=" << _i << endl; };

    ~X()
    { cout << "released! &x=" << this << ", i=" << _i << endl; };

    X(const X &x)
    {
        _i = x._i;
        cout << "copy! &x=" << this << ", i=" << _i << ", &target=" << &x << endl;
    };

    X operator+(const X &x) const
    {
        X new_x(0);
        new_x._i = this->_i + x._i;
        return new_x;
    };

    bool operator<(const X &x) const
    {
        return this->_i < x._i;
    };
};

int main()
{
    X x(1);
    set<X> my_set;
    cout << "insert(x)" << endl;
    my_set.insert(x);
    cout << "insert(x+x)" << endl;//OTZ
    //my_set.insert(x + x);
    my_set.insert(x + x);
    cout << "insert(x)" << endl;
    //my_set.insert(move(x));
    my_set.insert(x);
    //cin.get();
    return 0;
}